<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<!DOCTYPE html>
<html>
<head>
<title>应用列表</title>
<meta charset="UTF-8">
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport"
	content="width=device-width, initial-scale=1, maximum-scale=1">
<link rel="stylesheet" href="/resources/layui/css/layui.css" media="all">
<script src="/resources/layui/layui.js" charset="utf-8"></script>
<style type="text/css">
th, td {
	text-align: center !important;
}
</style>
</head>
<body style="padding: 30px 60px; background-color: #e6e6e6c2;">
	<div style="margin: 0 auto">
		<div>
			<form class="layui-form" action="/" method="post">
				<div class="layui-form-item layui-input-inline">
					<input type="text" name="applicationName" lay-verify="required"
						placeholder="应用名称模糊搜索" autocomplete="off"
						value="${applicationName}" class="layui-input layui-input-inline">
					<button class="layui-btn layui-input-inline" lay-submit
						lay-filter="findApplicationListForm" style="width: 60px;">搜索</button>
				</div>
				<div class="layui-form-item layui-input-inline"
					style="margin-left: 360px">
					<button class="layui-btn layui-input-inline" style="width: 150px;">应用总数：${xRpcConfigListInfor.totalApplication}</button>
					<button class="layui-btn layui-btn-normal layui-input-inline"
						style="width: 150px;">服务提供者：${xRpcConfigListInfor.totalProvider}</button>
					<button class="layui-btn layui-btn-warm layui-input-inline"
						style="width: 150px;">服务消费者：${xRpcConfigListInfor.totalConsumer}</button>
				</div>
			</form>
		</div>
		<div>
			<table class="layui-table">
				<thead>
					<tr>
						<th>应用名称</th>
						<th>主机地址</th>
						<th>提供服务数量</th>
						<th>引用服务数量</th>
						<th>应用启动时间</th>
						<th>操作</th>
					</tr>
				</thead>
				<tbody>
					<c:forEach items="${xRpcConfigList}" var="xRpcConfig">
						<tr>
							<td>${xRpcConfig.applicationConfig.name}</td>
							<td>${xRpcConfig.applicationConfig.hostAddress}</td>
							<td>${fn:length(xRpcConfig.serviceBeanList)}</td>
							<td>${fn:length(xRpcConfig.referenceBeanList)}</td>
							<td><fmt:formatDate value="${xRpcConfig.startUpTime}"
									pattern="yyyy-MM-dd HH:mm:ss" /></td>
							<td><a
								href="/xrpc-admin/application/${xRpcConfig.applicationConfig.name}" target="_blank"
								class="layui-btn layui-btn-sm">应用详情</a></td>
						</tr>
					</c:forEach>
				</tbody>
			</table>
		</div>
	</div>
</body>
</html>
